home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14788 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: news.dal.ca!news
  2. From: Klaus.Eichele@Dal.Ca (Klaus Eichele)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: I've discovered sound!
  5. Date: Tue, 02 Apr 1996 05:21:32 GMT
  6. Organization: Dalhousie University
  7. Message-ID: <4jpvkm$gcv@News.Dal.Ca>
  8. References: <4jph80$aj2@news1.warwick.net>
  9. NNTP-Posting-Host: rewasylishen.chem.dal.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. vidman@warwick.net (i've discovered sound!) wrote:
  13.  
  14. >I've just discovered the sound() function in dos.h  Unfortunately it
  15. >only uses frequency's.  Can anyone tell me which frequency's go with
  16. >which notes, and how to convert from octave to octave?
  17.  
  18. Hi, 
  19. here are a few octaves I calculated myself. I used "well-tempered"
  20. ratios, starting for the standard note for tuning, 'a1', with a
  21. frequency of 440 Hz (nowadays, however, a slightly higher frequency is
  22. generally used). A higher octave has double the frequency, a lower
  23. octave half the frequency, etc. A half-tone higher is generated by
  24. multiplying by the twelfth root of 2. The suffix 'is' corresponds to
  25. the 'sharp'. (I used German names, but you certainly can change that).
  26.  
  27.  
  28. /* ------------------------------------------------------------------
  29.                     small octave
  30.   ------------------------------------------------------------------*/
  31. #define   c      130.818
  32. #define   cis    138.591
  33. #define   d      146.832
  34. #define   dis    155.563
  35. #define   e      164.814
  36. #define   f      174.614
  37. #define   fis    184.997
  38. #define   g      195.998
  39. #define   gis    207.652
  40. #define   a      220.000
  41. #define   ais    233.082
  42. #define   h      246.942
  43.  
  44. /* ------------------------------------------------------------------
  45.                     single primed octave
  46.   ------------------------------------------------------------------*/
  47. #define   c1     261.623
  48. #define   cis1   277.183
  49. #define   d1     293.665
  50. #define   dis1   311.127
  51. #define   e1     329.628
  52. #define   f1     349.228
  53. #define   fis1   369.994
  54. #define   g1     391.995
  55. #define   gis1   415.305
  56. #define   a1     440.000
  57. #define   ais1   466.164
  58. #define   h1     493.883
  59.  
  60. /* ------------------------------------------------------------------
  61.                     double primed octave
  62.   ------------------------------------------------------------------*/
  63. #define   c2     523.251
  64. #define   cis2   554.365
  65. #define   d2     587.330
  66. #define   dis2   622.254
  67. #define   e2     659.255
  68. #define   f2     698.456
  69. #define   fis2   739.990
  70. #define   g2     783.991
  71. #define   gis2   830.609
  72. #define   a2     880.000
  73. #define   ais2   932.328
  74. #define   h2     987.767
  75.  
  76. Good Luck,
  77. Klaus
  78. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  79. Klaus Eichele         keichele@is.dal.ca  
  80. http://is.dal.ca/~keichele/keichele.html
  81.  
  82.